ss = "aegcbbcc"

def fun(ss):
    a = -1
    while a < len(ss) - 2:
        a += 1
        if ss[a] == ss[a + 1]:
            ss = ss.replace(f"{ss[a:a + 2]}", "")
            a = -1
    return ss



print(fun(ss))

ss = "aegcbbcc"
# 方法2
def func(s):
    res = ''
    for i in s:
        if res == '':
            res += i
        elif res[-1] == i:
            res = res[:-1]
        else:
            res += i
    return res


print(func(ss))


b = 3
if b > -2:
    print(11)
elif b > -3:
    print(33)

b = 3
if b > -2:
    print(11)
if b > -3:
    print(33)

s = "12345"
sss = s[:-1]
print(sss)